import axios from 'axios'
export function getLyric(mid) {

  const url = '/api/getLyric'
  
  const data = {
    '-': 'MusicJsonCallback_lrc',
    pcachetime: (new Date()).getTime(),
    songmid: `${mid}`,
    g_tk: 5381,
    hostUin: 0,
    format: 'json',
    inCharset: 'utf8',
    outCharset: 'utf-8',
    notice: 0,
    platform: 'yqq.json',
    needNewCode: 0
  }
  
  return axios( url, {
    params: data
  }).then((res) => {
    return Promise.resolve(res.data)
  })
}

export function getMiguLyric(mid) {

  const url = '/api/getMiguLyric'
  
  const data = {
    copyrightId: mid
  }
  
  return axios( url, {
    params: data
  }).then((res) => {
    return Promise.resolve(res.data)
  })
}